<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
	Monetizations
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
<div id="content" class="box">
	<h1>Monetizations</h1>
	<div id="menu" class="box">
		<ul class="box">
			<li><a href="<?php echo url('monetization/insert');?>"><span>Add</span></a></li>
		</ul>
	</div>
		<?php if (isset($infos)) 
				{
					foreach ($infos as $info)
					{
		?>
				<p class="msg info"><?php echo $info;?></p>
		<?php		}
				}
		?>
	<table class="full-size" style="text-align:center;">
		<tbody>
			<tr>
				<th>Name</th>
				<th>Note</th>
				<th>Html</th>
				<th>Secret Key</th>
				<th>Application ID</th>
				<th>Operate</th>
			</tr>
			<?php
				if(!empty($monetizations)){
					$bg = false;
					foreach ($monetizations as $monetization)
					{				
			?>
						<tr <?php if ($bg) echo 'class="bg"';?>>
							<td><?php echo $monetization['name'];?></td>
							<td><?php echo $monetization['note'];?></td>
							<td><?php echo htmlentities($monetization['html']);?></td>
							<td><?php echo $monetization['secret_key'];?></td>
							<td><?php echo $monetization['app_id'];?></td>
							<td>
								<a href="<?php echo url('monetization/update', array('id'=>$monetization['id']));?>">Edit</a>&nbsp;&nbsp;&nbsp;&nbsp;
								<a href="<?php echo url('monetization/delete', array('id'=>$monetization['id']));?>">Delete</a>
							</td>
						</tr>
			<?php
						$bg = !$bg;
					}
				}
			?>
		</tbody>
	</table>
</div>
<?php $this->_endblock(); ?>